package com.none.web.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * TUser entity. @author MyEclipse Persistence Tools
 * Dave   20141105
 * user in the App
 */
@Entity
@Table(name = "t_user_app")
public class TUserApp implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields
	private String userId;
	private String userName;
	private String password;
	private String face; // 脸型
	private Integer state; // 状态
	private String role; // 权限
	private String position; // 位置
	private String email;// email
	private TCodes tcodes;// 激活码
	private Timestamp createTime;// 创建时间
	private Timestamp lastTime;// 最后修改时间
	private Timestamp loginTime;// 最后登陆时间
	private String userUDID;// app用户的udid
	private String userType;// 用户权限类型
	private String branch;// 部门
	
	private String staffId;// staffId
	private String english_name;// 英文名字
	private String chinese_name;// 中文名字
	private String phone;// 部门
	private String push_id;// 百度推送给的唯一ID（userId）
	private String device_type;// ios    android
	
	
	private String isAdmin;//是否是管理员  Y  or  N
	

	

	private Set<TActivityAppUser> tactivityAppUsers=new HashSet<TActivityAppUser>();
    
	// Constructors

	/** default constructor */
	public TUserApp() {
	}

	/** minimal constructor */
	public TUserApp(String userId) {
		this.userId = userId;
	}

	/** full constructor */
	public TUserApp(String userId, String userName, String password, String email, String face, Integer state,
			String position, TCodes tcodes, Timestamp createTime, Timestamp lastTime, Timestamp loginTime,
			String userUDID, String role, String userType, String branch,String isAdmin) {
		this.userId = userId;
		this.userName = userName;
		this.password = password;
		this.face = face;
		this.state = state;
		this.position = position;
		this.email = email;
		this.tcodes = tcodes;
		this.createTime = createTime;
		this.lastTime = lastTime;
		this.loginTime = loginTime;
		this.userUDID = userUDID;
		this.role = role;
		this.userType = userType;
		this.branch = branch;
		this.isAdmin = isAdmin;
	}

	// Property accessors
	@Id
	@Column(name = "user_id", unique = true, nullable = false, length = 32)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "user_name", length = 10)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(name = "isAdmin")
	public String getIsAdmin() {
		return isAdmin;
	}

	public void setIsAdmin(String isAdmin) {
		this.isAdmin = isAdmin;
	}
	@Column(name = "password", length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "face", length = 50)
	public String getFace() {
		return this.face;
	}

	public void setFace(String face) {
		this.face = face;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "position", length = 10)
	public String getPosition() {
		return this.position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	@OneToOne
	@JoinColumn(name = "code_id")
	public TCodes getTcodes() {
		return tcodes;
	}

	public void setTcodes(TCodes tcodes) {
		this.tcodes = tcodes;
	}

	@Column(name = "create_time", nullable = false, length = 19)
	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "last_time", nullable = false, length = 19)
	public Timestamp getLastTime() {
		return lastTime;
	}

	public void setLastTime(Timestamp lastTime) {
		this.lastTime = lastTime;
	}

	@Column(name = "login_time", nullable = false, length = 19)
	public Timestamp getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Timestamp loginTime) {
		this.loginTime = loginTime;
	}

	@Column(name = "user_UDID", length = 40)
	public String getUserUDID() {
		return userUDID;
	}

	public void setUserUDID(String userUDID) {
		this.userUDID = userUDID;
	}

	@Column(name = "role", length = 200)
	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@Column(name = "user_type", length = 40)
	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	@Column(name = "branch", length = 40)
	public String getBranch() {
		return branch;
	}

	public void setBranch(String branch) {
		this.branch = branch;
	}

	

	// user  and userapp  mapping
	
	@OneToMany(mappedBy = "appUser")
	public Set<TActivityAppUser> getTactivityAppUsers() {
		return tactivityAppUsers;
	}

	public void setTactivityAppUsers(Set<TActivityAppUser> tactivityAppUsers) {
		this.tactivityAppUsers = tactivityAppUsers;
	}

	@Column(name = "staffId")
	public String getStaffId() {
		return staffId;
	}

	public void setStaffId(String staffId) {
		this.staffId = staffId;
	}
	@Column(name = "english_name")
	public String getEnglish_name() {
		return english_name;
	}

	public void setEnglish_name(String english_name) {
		this.english_name = english_name;
	}
	@Column(name = "chinese_name")
	public String getChinese_name() {
		return chinese_name;
	}

	public void setChinese_name(String chinese_name) {
		this.chinese_name = chinese_name;
	}
	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @return the push_id
	 */
	public String getPush_id() {
		return push_id;
	}

	/**
	 * @param push_id the push_id to set
	 */
	public void setPush_id(String push_id) {
		this.push_id = push_id;
	}

	/**
	 * @return the device_type
	 */
	public String getDevice_type() {
		return device_type;
	}

	/**
	 * @param device_type the device_type to set
	 */
	public void setDevice_type(String device_type) {
		this.device_type = device_type;
	}
	
	
	
	
	
}